package mx.com.matersys.vacs.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.TableGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooEntity(versionField = "", table = "anomalias")
public class Anomalias {
	@Id
	@TableGenerator(name="GEN_ANOM", table="sequence", pkColumnName="SEQ_NAME", valueColumnName="SEQ_COUNT", pkColumnValue="SEQ_ANOM", allocationSize=1)
	@GeneratedValue(strategy=GenerationType.TABLE, generator="GEN_ANOM")
    @Column(name = "idanomalia")
    private Integer idanomalia;
	
	@ManyToOne
    @JoinColumn(name = "idlectura", referencedColumnName = "idlectura")
    private RegistroLectura idlectura;
    
    @Column(name = "descripcion", length = 300)
    private String descripcion;
    
    @Column(name = "relevacia")
    private Short relevacia;
    
    @Column(name = "id_evento")
    private Integer idEvento;
    
    @Column(name = "hora_anomalia")
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "M-")
    private Date horaAnomalia;
}
